-
Notifications
You must be signed in to change notification settings - Fork 5k
Port Microsoft.Extensions.AI.AzureAIInference to Azure.AI.Inference #50097
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thank you for your contribution @jozkee! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ports Microsoft.Extensions.AI.AzureAIInference into the Azure.AI.Inference namespace and updates associated tests and clients. Key changes include:
- Adding test utilities (e.g. VerbatimHttpHandler) and comprehensive tests for image and text embedding generators.
- Updating project files with new package references and embedded resources.
- Implementing new client wrappers and extension methods to expose endpoints and generate embeddings via ImageEmbeddingsClient, EmbeddingsClient, and ChatCompletionsClient.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
sdk/ai/Azure.AI.Inference/tests/Utilities/VerbatimHttpHandler.cs | Added a custom HttpMessageHandler for request/response validation in tests. |
sdk/ai/Azure.AI.Inference/tests/AzureAIInferenceImageEmbeddingGeneratorTests.cs | Introduced tests for image embedding generation and validated response metadata. |
sdk/ai/Azure.AI.Inference/tests/AzureAIInferenceEmbeddingGeneratorTests.cs | Added tests for text embedding generation including usage metrics validation. |
sdk/ai/Azure.AI.Inference/tests/Azure.AI.Inference.Tests.csproj | Updated project references and embedded resource configuration. |
sdk/ai/Azure.AI.Inference/src/Customized/*.cs | Added clients, extension methods, and generator implementations to wrap Azure.AI.Inference functionality. |
eng/Packages.Data.props | Updated package references for integrations with AI and caching abstractions. |
|
||
foreach (Embedding<float> e in response) | ||
{ | ||
Assert.That(e.ModelId, Is.EqualTo("embed-v4.0")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test constructs the generator with a default model ID of 'embed-v-4-0' yet later asserts the produced ModelId is 'embed-v4.0'. If this conversion is intentional, please document the transformation for clarity; otherwise, consider aligning the model naming consistently.
Copilot uses AI. Check for mistakes.
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
…tionFactory on embedding generators.
sdk/ai/Azure.AI.Inference/src/Customized/AzureAIInferenceEmbeddingGenerator.cs
Outdated
Show resolved
Hide resolved
sdk/ai/Azure.AI.Inference/src/Customized/AzureAIInferenceEmbeddingGenerator.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General conventions and repo-level changes look good. I don't have enough understanding of the extensions themselves to offer deeper thoughts there, so I'll defer to @jeffhandley's judgement.
When you feel confident that things are in good shape, yell and I'll get this merged.
Thanks, @jsquire. It's ready to merge. :-) |
Code was originally located in
https://github.com/dotnet/extensions/tree/749caedb584a20811c5ebe1b00db7763fbcaac93/src/Libraries/Microsoft.Extensions.AI.AzureAIInference
@stephentoub @jeffhandley